<?php
class PBS_Season
{
	/**
	 * Objet sql
	 *
	 * @var Db_Spdo
	 */
	private $oSql;
	
	public function __construct()
	{
		$this->oSql = Db_Spdo::getInstance();
	}
	
	/**
	 * Ajout d'un bug
	 *
	 * @return boolean
	 */
	public function add()
	{
		list($d,$m,$y) = explode('/',$_POST['date']);
		$datas = array(':nom'=>$_POST['nom'],':date'=>$y.'-'.$m.'-'.$d);
		$prepare = $this->oSql->prepare('INSERT INTO seasons (name,date) VALUES(:nom,:date)');
		$ret =  $prepare->execute($datas);
		return $ret;
	}
}